include(FindProtobuf)
# 查找protobuf库文件
find_package(Protobuf REQUIRED)
# 将protobuf头文件添加到搜索路径
include_directories(${PROTOBUF_INCLUDE_DIR})
# 生成cc的头文件和代码
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER addressbook.proto)
# 链接称为proto动态库
add_library(proto SHARED ${PROTO_HEADER} ${PROTO_SRC})